<template>
	<view class="main setting-main">
		<NavigationBar title="个人资料" />
		<view class="scroll-wrap">
			<view class="cell-wrap">
				<view class="cell-item b-b" @click="jumpAction('/pages/userInfo/userInfo')">
					<view class="left">个人资料</view>
					<view class="right">
						<text class="iconfont rigt-arrow-icon">&#xe60a;</text>
					</view>
				</view>
				<view class="cell-item b-b">
					<view class="left">通知设置</view>
					<view class="right">
						<switch class="default-switch" checked color="#fa2c19" @change="switchChange" />
					</view>
				</view>
				<view class="cell-item b-b" @click="jumpAction('/pages/setPassword/setPassword')">
					<view class="left">支付密码设置</view>
					<view class="right">
						<text class="iconfont rigt-arrow-icon">&#xe60a;</text>
					</view>
				</view>
				<view class="cell-item b-b" @click="jumpAction('/pages/about/about')">
					<view class="left">关于我们</view>
					<view class="right">
						<text class="iconfont rigt-arrow-icon">&#xe60a;</text>
					</view>
				</view>
			</view>
			<view class="submit-btn-wrap">
				<view class="submit-btn flex-center" @click="signOutAction">
					<text class="btn-text">退出登录</text>
				</view>
			</view>
		</view>
	</view>
</template>

<script lang="ts">
	import util from '@/static/js/util';
	import { mapMutations } from 'vuex';
	export default {
		data() {
			return {
				
			};
		},
		methods: {
			signOutAction() {
				const _this:any = this
				uni.showLoading({title: '加载中',mask:true});
				_this.signOut()
				setTimeout(()=>{
					uni.hideLoading()
					util.goBack()
				},500);
				
			},
			switchChange: function(e: any) {
				console.log('值为', e.target.value) 
			},
			jumpAction(url: any) {
				util.jumpPage(url)
			},
			...mapMutations(['signOut'])
		}
	}
</script>

<style lang="scss">
	@import  './setting.scss'
</style>
